package cn.bb.pojo;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

import java.io.Serializable;
@Component("mainFrame")
public class MainFrame implements Serializable {
    @Value("小水牛")
    private String modelType;
    public void printlnModelType(){
        System.out.println("电脑的型号是："+modelType);
    }

    //设值注入是指通过setter方法传入被调用者的实例
    public void setModelType(String modelType) {
        this.modelType = modelType;
    }
}
